<?php

class Common_Exception extends Exception {
    
    private $arr_internal_exceptions = array();
    
    public function addInternalExceptions($mix_exceptions) {
        
        if(
            (is_object($mix_exceptions) && ($mix_exceptions instanceof Exception)) ||
            is_string($mix_exceptions)
        ) {
        
            $this->arr_internal_exceptions[] = $mix_exceptions;
            
        } else if(is_array($mix_exceptions)) {
            foreach($mix_exceptions as $mix) {
                $this->addInternalExceptions($mix);
            }
        }
        
    }
    
    public function hasInternalExceptions() {
        return !empty($this->arr_internal_exceptions);
    }
    
    public function getInternalExceptions() {
        return $this->arr_internal_exceptions;
    }
    
}
